
function User() {}
User.prototype.name = function() {
  console.log("user.name");
};
// let hd = new User();
// hd.name();

function Admin() {}
Admin.prototype = Object.create(User.prototype);
Admin.prototype.role = function() {
  console.log("admin.role");
};

function Member() {}
Member.prototype = Object.create(User.prototype, {
	role: {
		value: function() {
		  console.log("member.role");
		},
		enumerable: true
	}
});




let a = new Admin();
a.role();
console.log(a.constructor)

for(var i in a ) {
	console.log(i + " : " + a[i])
}

console.log('--------------------------------------------\n')

let m = new Member();
m.role();
console.log(m.constructor)

for(var i in m ) {
	console.log(i + " : " + m[i])
}

// console.log('-----------------------\n')
// console.log(Object.getOwnPropertyDescriptors(m.__proto__))
